
/**
** \file       exec_cmplist.c
**
** \brief      this function execute compound list rule
**
** \author     Ben M'rad Hanna, Laterem Hamza, Boillot Ulysse, De Olivera
**             Guillaume and Nguyen Viet Dung
**
** \version    0.8
**
** \date       27 November 2010
**
*/

#include "execution.h"

int             exec_cmpdlist(s_cmpdlist      *node)
{
  s_andor       *tmp_andor = NULL;
  int           k = 0;

  tmp_andor = node->andor;

  while (tmp_andor != NULL)
  {
    if (tmp_andor->pl != NULL)
      k = exec_andor(tmp_andor);
    else
      return (0);

    tmp_andor = tmp_andor->next;

    if (k != 0)
      return (1);
  }

  return (0);
}
